function [eqmin] = fractionateAmphibole(liquidComp,FeMgKD)

MW = [60.085 79.899	101.961	151.9902	71.846	70.9374	40.311	56.079	61.979	94.203	283.89]; % see matlab guide in excel spreadsheet
%     SiO2    TiO2    Al2O3   Cr2O3       FeO     MnO     MgO     CaO    Na2O    K2O    P2O5
%      1        2       3       4           5       6       7       8     9

liquidComp_moles = liquidComp./MW;
liquidComp_moles = 100*liquidComp_moles/nansum(liquidComp_moles); %%normalizes the molar liquid composition, unneccessary step

XRAT = liquidComp_moles(5)./liquidComp_moles(7);
VAM = FeMgKD*XRAT;
XAM = VAM./(1+VAM);

    M_eqmin(1) = 43.89;
    M_eqmin(2) = 2.46;
    M_eqmin(3) = 6.79;
    M_eqmin(4) = 0;
    M_eqmin(5) = 32.83*XAM;
    M_eqmin(6) = 0;
    M_eqmin(7) = 32.83*(1-XAM);
    M_eqmin(8) = 11.35;
    M_eqmin(9) = 2.42;
    M_eqmin(10) = 0.25;
    M_eqmin(11) = 0;
    

    eqmin = M_eqmin.*MW;                % this is the bulk comosition of equilibrium olivine
    eqmin = eqmin./(0.01*sum(eqmin));   % renormalized and in wt%
    

end

